home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / git-4.3 / git-4 / git-4.3.7 / src / tty.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-08  |  4.4 KB  |  160 lines

  1. /* tty.h -- #defines, data structures & function prototypes for tty.c stuff. */
  2.  
  3. /* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
  4.  
  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 2, or (at your option)
  8.    any later version.
  9.  
  10.    This program is distributed in the hope that it will be useful,
  11.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.    GNU General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU General Public License
  16.    along with this program; if not, write to the Free Software
  17.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. /* Written by Tudor Hulubei and Andrei Pitis.  */
  20.  
  21.  
  22. #ifndef _GIT_TTY_H
  23. #define _GIT_TTY_H
  24.  
  25.  
  26. #include <sys/types.h>
  27.  
  28. #ifdef HAVE_POSIXTTY
  29. #include <termios.h>
  30. #else
  31. #ifdef HAVE_SYSTEMVTTY
  32. #include <termio.h>
  33. #else
  34. #include <sgtty.h>
  35. #endif /* HAVE_SYSTEMVTTY */
  36. #endif /* HAVE_POSIXTTY */
  37.  
  38. #include "window.h"
  39.  
  40.  
  41. #ifndef _POSIX_VDISABLE
  42. #define _POSIX_VDISABLE 0
  43. #endif
  44.  
  45. #define MAX_TTY_COLUMNS         512
  46. #define MAX_TTY_ROWS            512
  47.  
  48.  
  49. #define MAX_CAPABILITY_LEN       64     /* If you have greater terminal
  50.                                            capabilities change this */
  51.  
  52. #define OFF                     0
  53. #define ON                      1
  54.  
  55. /* Color constants.  */
  56. #define BLACK                   0
  57. #define RED                     1
  58. #define GREEN                   2
  59. #define YELLOW                  3
  60. #define BLUE                    4
  61. #define MAGENTA                 5
  62. #define CYAN                    6
  63. #define WHITE                   7
  64.  
  65.  
  66. /* Some key aliases.  */
  67. #define key_CTRL_G              0007            /* Ctrl-G               */
  68. #define key_CTRL_Z              0032            /* Ctrl-Z               */
  69. #define key_ENTER               0012            /* Enter                */
  70. #define key_BACKSPACE           0177            /* Backspace            */
  71. #define key_TAB                 0011            /* Tab                  */
  72.  
  73.  
  74. /* The interrupt character.  */
  75. #define key_INTERRUPT           key_CTRL_G
  76. #define key_SUSPEND             key_CTRL_Z
  77.  
  78.  
  79. /* Terminal modes.  */
  80. #define TTY_CANONIC     0
  81. #define TTY_NONCANONIC  1
  82.  
  83.  
  84. /* Terminal input modes.  */
  85. #define TTY_RESTRICTED_INPUT    0
  86. #define TTY_FULL_INPUT          1
  87.  
  88.  
  89. #define is_print(c)             ((c) >= ' ' && (c) <= '~')
  90.  
  91.  
  92. extern void (* tty_enter_idle_hook) __P(());
  93. extern void (* tty_exit_idle_hook) __P(());
  94.  
  95.  
  96. typedef struct tag_tty_key_t
  97. {
  98.     unsigned char *key_seq;
  99.     struct tag_tty_key_t *next;
  100.     void *aux_data;
  101. } tty_key_t;
  102.  
  103.  
  104. typedef struct 
  105. {
  106.     int fg_color;
  107.     int bg_color;
  108.     int br_status;
  109.     int rv_status;
  110.     int cursor_status;
  111.     unsigned char attribute;
  112. } tty_status_t;
  113.  
  114.  
  115. extern void tty_startup __P(());
  116. extern void tty_exit __P(());
  117.  
  118. extern void tty_get_capabilities __P(());
  119. extern void tty_kbdinit __P((int));
  120. extern void tty_set_mode __P((int));
  121. extern void tty_set_interrupt_char __P((unsigned char));
  122.  
  123. extern void tty_clear __P(());
  124. extern void tty_touch __P(());
  125. extern void tty_cursormove __P((int, int));
  126. extern void tty_cursormove_notify __P((int, int));
  127. extern void tty_brightness __P((int));
  128. extern void tty_foreground __P((int));
  129. extern void tty_background __P((int));
  130. extern void tty_colors __P((int, int, int));
  131. extern void tty_cursor __P((int));
  132. extern void tty_beep __P(());
  133. extern void tty_defaults __P(());
  134. extern void tty_save __P((tty_status_t *));
  135. extern void tty_restore __P((tty_status_t *));
  136. extern size_t tty_write __P((char *, size_t));
  137. extern size_t tty_read __P((char *, size_t));
  138. extern size_t tty_put_char __P((char));
  139. extern int tty_get_char __P(());
  140. extern void tty_get_size __P((int *, int *));
  141. extern void tty_get_screen __P((char *));
  142. extern void tty_put_screen __P((char *));
  143. extern int tty_get_color_index __P((char *));
  144. extern void tty_key_list_insert __P((unsigned char *, void *));
  145. extern void tty_key_search_restart __P(());
  146. extern char *tty_key_convert __P((unsigned char *));
  147. extern char *tty_get_symbol_key_seq __P((char *));
  148. extern void tty_get_exit_colors __P(());
  149. extern int tty_set_optimization_level __P((int));
  150. /*
  151. extern void tty_key_list_delete __P(());
  152. */
  153.  
  154.  
  155. extern tty_key_t *tty_key_search __P((char *));
  156. extern tty_key_t *tty_get_key __P((int *));
  157.  
  158.  
  159. #endif  /* _GIT_TTY_H */
  160.